import http from "@/utils/request/httpRequest.ts";
import type {
    ExpertLoginBodyType, ExpertLoginType,
    LoginCode,
    LoginPhoneSubmitType,
    LoginSubmitResponseType,
    LoginSubmitType,
    RandomImage
} from "@/types/loginType.ts";
import outHttp from "@/utils/request/httpOutRequest.ts";
// 获取图形验证码
export const getRandomImage = (data: {
    key: number
}) => http.get<RandomImage>('sys/login/randomImage', {
    params: data
})
// 账号密码登录
export const pwdLogin = (data: LoginSubmitType) => http.post<LoginSubmitResponseType>('sys/login/pwdLogin', data)
// 手机号登录
export const phoneLogin = (data: LoginPhoneSubmitType) => http.post<LoginSubmitResponseType>('sys/login/phoneLogin', data)
// 手机号验证码获取
export const phoneSms = (data: LoginCode) => http.post<null>('sys/login/sms', data)
// 专家登录
export const expertLogin = (data: ExpertLoginBodyType) => outHttp.post<ExpertLoginType>('teacher/login', data)
